package com.lc.admin.web;

import com.lc.admin.base.ResponseResult;
import lombok.Data;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;

@RestController
@RequestMapping("/product")
public class TestAxiosWeb {

    @GetMapping("/findById")
    public ResponseResult<Product> findById(Integer id) {
        Product p = new Product();
        p.setId(1001);
        p.setName("外星人笔记本");
        p.setPrice(new BigDecimal(12999.00));

        return ResponseResult.success(p);
    }
}

@Data
class Product{
    private Integer id;
    private String name;
    private BigDecimal price;
}
